package com.geek.framework.study.common;


public interface ThrowableSupplier<T> {

  T get() throws Throwable;



  /**
   * execute without exception
   * @param supplier
   * @param <T>
   * @return
   */
  static <T> T execute(ThrowableSupplier<T> supplier) {
    try {
      return supplier.get();
    } catch (Throwable e) {
      throw new BaseException();
    }
  }




}